load("//tools:defaults.bzl", "api_golden_test", "api_golden_test_npm_package", "generate_api_docs", "ng_package", "ng_project")

package(default_visibility = ["//visibility:public"])

ng_project(
    name = "animations",
    srcs = glob(
        [
            "*.ts",
            "src/**/*.ts",
        ],
    ),
    deps = [
        "//packages/core",
    ],
)

ng_package(
    srcs = [
        "package.json",
    ],
    package = "@angular/animations",
    tags = [
        "release-with-framework",
    ],
    # Do not add more to this list.
    # Dependencies on the full npm_package cause long re-builds.
    visibility = [
        "//adev:__pkg__",
        "//integration:__subpackages__",
        "//modules/ssr-benchmarks:__subpackages__",
        "//packages/compiler-cli/integrationtest:__pkg__",
        "//packages/compiler/test:__pkg__",
    ],
    deps = [
        ":animations",
        "//packages/animations/browser",
        "//packages/animations/browser/testing",
    ],
)

api_golden_test_npm_package(
    name = "animations_api",
    data = [
        ":npm_package",
        "//goldens:public-api",
    ],
    golden_dir = "goldens/public-api/animations",
    npm_package = "packages/animations/npm_package",
)

api_golden_test(
    name = "animations_errors",
    data = [
        "//goldens:public-api",
        "//packages/animations",
    ],
    entry_point = "src/errors.d.ts",
    golden = "goldens/public-api/animations/errors.api.md",
)

filegroup(
    name = "files_for_docgen",
    srcs = glob([
        "*.ts",
        "src/**/*.ts",
    ]) + ["PACKAGE.md"],
)

generate_api_docs(
    name = "animations_docs",
    srcs = [
        ":files_for_docgen",
    ],
    entry_point = ":index.ts",
    module_name = "@angular/animations",
)
